<style>
@media print {
  ._wz_screeningProgramDetails {
    -webkit-print-color-adjust: exact;
    height: inherit !important;
    font-size: 12px !important;
  }
}
</style>
<template>
  <div class="_wz_cent_main _wz_screeningProgramDetails" ref="screeningProgramDetails">
    <table cellpadding="0" cellspacing="0" border="0">
      <colgroup>
        <col width="13%">
        <col width="20%">
        <col width="13%">
        <col width="20%">
        <col width="13%">
        <col width="20%">
      </colgroup>
      <tbody>
      <tr>
        <td style="font-weight: 600;position:relative;" colspan="6">基本信息</td>
      </tr>
      <tr>
        <td>排查计划</td>
        <td colspan="3">{{!!selectData.riskPlanName ? selectData.riskPlanName:'--'}}</td>
        <td>计划状态</td>
        <td>
          <Tag color="warning" type="dot" v-if="selectData.riskPlanState == 0">未派发</Tag>
          <Tag color="primary" type="dot" v-if="selectData.riskPlanState == 1">派发中</Tag>
          <Tag color="success" type="dot" v-if="selectData.riskPlanState == 2">已完成</Tag>
        </td>
      </tr>
      <tr>
        <td>排查类型</td>
        <td>{{!!selectData.riskPlanCycleName ? selectData.riskPlanCycleName:'--'}}</td>
        <td>排查周期</td>
        <td>
          <Tag v-if="selectData.riskPlanCycleUnit == 1">每 {{selectData.riskPlanCycleNum}} 日 1 次</Tag>
          <Tag v-if="selectData.riskPlanCycleUnit == 2">每 {{selectData.riskPlanCycleNum}} 周 1 次</Tag>
          <Tag v-if="selectData.riskPlanCycleUnit == 3">每 {{selectData.riskPlanCycleNum}} 旬 1 次</Tag>
          <Tag v-if="selectData.riskPlanCycleUnit == 4">每 {{selectData.riskPlanCycleNum}} 月 1 次</Tag>
          <Tag v-if="selectData.riskPlanCycleUnit == 5">每 {{selectData.riskPlanCycleNum}} 季 1 次</Tag>
          <Tag v-if="selectData.riskPlanCycleUnit == 6">每 {{selectData.riskPlanCycleNum}} 年 1 次</Tag>
        </td>
        <td>发布时间</td>
        <td>{{!!selectData.riskPlanReleaseDate ? selectData.riskPlanReleaseDate:'--'}}</td>
      </tr>
      <tr>
        <td>时间范围</td>
        <td colspan="3">
          {{ selectData.riskPlanStartDate + ' 至 ' + selectData.riskPlanEndDate}}
        </td>
        <td>创建时间</td>
        <td>{{!!selectData.createTime ? selectData.createTime:'--'}}</td>
      </tr>
      <tr>
        <td>运输企业</td>
        <td colspan="5">{{!!selectData.deptName ? selectData.deptName:'--'}}</td>
      </tr>
      </tbody>
    </table>
    <table cellpadding="0" cellspacing="0" border="0">
      <colgroup>
        <col width="10%">
        <col width="10%">
        <col width="20%">
        <col width="10%">
        <col width="20%">
        <col width="10%">
        <col width="20%">
      </colgroup>
      <tbody>
      <tr>
        <td style="font-weight: 600;position:relative;border-top: 0px;" colspan="7">隐患部位</td>
      </tr>
      <template v-for="item,index in riskPlanItemList">
        <tr>
          <td rowspan="2"><Tag color="blue">第 {{index+1}} 项</Tag></td>
          <td>隐患部位</td>
          <td>{{item.riskPositionName}}</td>
          <td>隐患类型</td>
          <td>
            <Tag color="success" type="dot" v-if="item.riskPositionType == 1">基础管理</Tag>
            <Tag color="primary" type="dot" v-if="item.riskPositionType == 2">设备设施</Tag>
            <Tag color="warning" type="dot" v-if="item.riskPositionType == 3">作业活动</Tag>
          </td>
          <td>隐患项目</td>
          <td>共 {{item.riskPositionItemCount}} 项</td>
        </tr>
        <tr>
          <td>排查渠道</td>
          <td>
            <Tag color="success" type="dot" v-if="item.riskPlanItemType == 1">管理型单位</Tag>
            <Tag color="primary" type="dot" v-if="item.riskPlanItemType == 2">生产型单位</Tag>
          </td>
          <td>排查人员</td>
          <td colspan="3">{{item.riskPlanItemCheckName}}</td>
        </tr>
      </template>
      </tbody>
    </table>
  </div>
</template>
<script>
export default {
  props: ["selectData"],
  data() {
    return {
      riskPlanItemList:[],
    }
  },
  computed: {//计算属性

  },
  beforeCreate() {//beforeCreate创建前状态

  },
  created() {//created创建完毕状态

  },
  beforeMount() {//beforeMount挂载前状态   DOM 元素然后塞入页面的过程

  },
  mounted() {//mounted 挂载结束状态
    let that = this;
    that.axios.post(that.apiUrl.riskPlanRiskPlanItemList, {riskPlanUuid:that.selectData.uuid}).then(res => {
      if (!!res) {
        that.riskPlanItemList = res.data.data;
      }
    }).catch(err => {
      console.log("失败", err)
    })

  },
  methods: {//执行的方法

  },
  watch: {//监听

  },
  beforeUpdate() {//beforeUpdate 更新前状态

  },
  updated() {//updated 更新完成状态

  },
  beforeDestroy() {//beforeDestroy 销毁前状态

  },
  destroyed() {//destroyed 销毁完成状态

  }
}
</script>
<style lang="less">
  ._wz_screeningProgramDetails{
    table {
      table-layout:fixed;
      width: 100%;
      border-collapse: collapse;
      border-spacing: 0;
      font-size: 12px !important;

      td {
        min-width: 0;
        height: 40px;
        box-sizing: border-box;
        text-align: left;
        text-overflow: ellipsis;
        border: 1px solid #515a6e;
        padding: 0 10px;
        word-break: break-word;
      }
    }

  }
</style>
